<style lang="less">
</style>
<template>
  <div>
    <Table :columns="titleName" :data="logsList" :loading="look_loading" stripe />
  </div>
</template>
<script>
import qs from "qs";
// import { computedTableHeight } from 'src/views/mixins/computedTableHeight';
// import showPictureMixin from 'src/views/mixins/showPictureMixin';

export default {
  name: "APILOOK",
  // mixins: [showPictureMixin, computedTableHeight],
  props: {
    logsList: {
      type: Array,
      required: true
    },
    look_loading: {
      type: Boolean,
      required: true
    }
  },
  data() {
    return {
      titleName: [
        {
          title: "api名称",
          key: "api"
        },
        {
          title: "IP",
          key: "host"
        },
        {
          title: "api url",
          key: "url"
        },
        // {
        // 	title: '调用api的参数',
        // 	key: 'params',
        // },
        {
          title: "调用结果是否成功",
          // key: 'success',
          render: (h, { row }) => {
            let issuccess = <div>-</div>;
            if (row.success === 1) {
              issuccess = <div>成功</div>;
            } else {
              issuccess = <div>失败</div>;
            }
            return issuccess;
          }
        },
        {
          title: "调用错误原因",
          // key: 'error',
          render: (h, { row }) => {
            let error;
            if (row.error) {
              error = <div>{row.error}</div>;
            } else {
              error = <div>-</div>;
            }

            return error;
          }
        },
        {
          title: "调用日期",
          key: "created_at",
          render: (h, { row }) => {
            let date = <div>无</div>;
            if (row.created_at) {
              this.$moment.locale(navigator.language);
              let real_Time = this.$moment
                .utc(`${row.created_at}`)
                .local()
                .format("lll");

              data = <div>{real_Time}</div>;
            }
            return date;
          }
        }
      ]
    };
  },
  methods: {}
};
</script>

